package com.lkd.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lkd.dto.RegionDto;
import com.lkd.dto.VmDto;
import com.lkd.entity.Node;
import com.lkd.entity.VendingMachine;
import com.lkd.mapper.NodeMapper;
import com.lkd.service.INodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.vo.NodeDetailVo;
import com.lkd.vo.NodeVo;
import com.lkd.vo.PageBean;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 点位表 服务实现类
 * </p>
 *
 * @author zzy
 * @since 2025-10-21
 */
@Service
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements INodeService {

    /**
     * 查看区域详情
     *
     * @param regionDto
     * @return
     */
    @Override
    public PageBean<NodeVo> search(RegionDto regionDto) {
        Page<NodeVo> page1 = new Page<>(regionDto.getPageIndex(),regionDto.getPageSize());

        Page<NodeVo> search = baseMapper.search(page1, regionDto);

        return new PageBean<>(search);
    }

    /**
     * 获取点位详情
     *
     * @param nodeId
     * @return
     */
    @Override
    public NodeDetailVo getVmList(Long nodeId) {
        NodeDetailVo list = baseMapper.getVmList(nodeId);
        return list;
    }
}
